package ua.org.cityid.shared.data;

import java.io.Serializable;
import java.util.List;

import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.IdentityType;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class City implements Serializable{
	private static final long serialVersionUID = -7029461033206463338L;

	@PrimaryKey
	private Long id;
	@Persistent
	private int regionId = 0;
	@Persistent
	private Boolean isModerated = false;
	@Persistent
	private String name;
	@Persistent
	private int phoneCode;
	@Persistent
	private List<Integer> zipCodes;

	public City() {
	}

	public City(int regionId, String name) {
		setRegionId(regionId);
		setName(name);
	}

	public City(Long newId, int regionId, String name) {
		this(regionId, name);
		setId(newId);
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getName() {
		return name;
	}

	private void setId(Long newId) {
		id = newId;
	}

	public Long getId() {
		return id;
	}

	public void setIsModerated(Boolean isModerated) {
		this.isModerated = isModerated;
	}

	public Boolean getIsModerated() {
		return isModerated;
	}

	public void setRegionId(int regionId) {
		this.regionId = regionId;
	}

	public int getRegionId() {
		return regionId;
	}

	public void setPhoneCode(int phoneCode) {
		this.phoneCode = phoneCode;
	}

	public int getPhoneCode() {
		return phoneCode;
	}

	public void setZipCodes(List<Integer> zipCodes) {
		this.zipCodes = zipCodes;
	}

	public List<Integer> getZipCodes() {
		return zipCodes;
	}
}
